<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>个人信用报告</title>
    <style>
        .max {
            width: 70%;
            margin: 0 auto;
        }

        img {
            width: 100%;
        }

        body {
            background-image: url(images/bag.png);
        }

        .max1 {
            width: 100%;
            height: 40px;
            line-height: 40px;
            text-align: center;
        }

        .max1>button {
            margin: 0;
            padding: 5px;
            font-size: 18px;
        }

        a {
            color: inherit;
            text-decoration: none;
        }
    </style>
</head>
<script>
    function downloadPDF() {
        var link = document.createElement('a');
        link.href = 'https://a-slice.gitee.io/yinhang/个人信用报告.pdf';
        link.download = '个人信用报告.pdf'; // 设置下载的文件名
        link.click();
    }
</script>

<body>

    <div class="max">
        <img src="images/666.jpg" alt="">
    </div>
    <div class="max1">

        <button><a onclick="downloadPDF()">生成PDF</a></button>
        <button id="closeBtn">关闭</button>
    </div>

</body>
<script>
    header('Content-Disposition: attachment; filename="个人信用报告.pdf"');
    header('Content-Type: application/pdf');
    readfile('个人信用报告.pdf');
</script>
<script>
    // 获取按钮元素
    var closeButton = document.getElementById("closeBtn");

    // 添加点击事件监听器
    closeButton.addEventListener("click", function () {
        // 关闭当前窗口
        window.close();
    });
</script>

</html>